home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Apple Location Manager / ALMInterfaces / LocationManager.a next >
Encoding:
Text File  |  1997-02-18  |  5.9 KB  |  221 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        LocationManager.a
  3. ;
  4. ;    Contains:    LocationManager (manange preferences for different physical locations)
  5. ;
  6. ;    Version:    System 7.6
  7. ;                Package:    Location Manager SDK 1.0
  8. ;
  9. ;    Copyright:    © 1984-1997 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__LOCATIONMANAGER__') = 'UNDEFINED' THEN
  19. __LOCATIONMANAGER__ SET 1
  20.  
  21.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  22.     include 'AppleEvents.a'
  23.     ENDIF
  24.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  25.     include 'Components.a'
  26.     ENDIF
  27.     IF &TYPE('__PROCESSES__') = 'UNDEFINED' THEN
  28.     include 'Processes.a'
  29.     ENDIF
  30.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  31.     include 'Dialogs.a'
  32.     ENDIF
  33. ;
  34. ;--------------------------------------------------------------------------------------
  35. ; Location token
  36. ;--------------------------------------------------------------------------------------
  37. ;
  38.  
  39.  
  40. ;
  41. ;--------------------------------------------------------------------------------------
  42. ; Public error codes 
  43. ;--------------------------------------------------------------------------------------
  44. ;
  45.  
  46. ALMInternalErr                    EQU        -30049
  47. ALMLocationNotFound                EQU        -30048
  48. ALMNoSuchModuleErr                EQU        -30047
  49. ALMModuleCommunicationErr        EQU        -30046
  50. ALMDuplicateModuleErr            EQU        -30045
  51. ALMInstallationErr                EQU        -30044
  52. ALMDeferSwitchErr                EQU        -30043
  53. ALMLastErr                        EQU        -30043
  54. ALMLastAllocatedErrNum            EQU        -30030
  55.  
  56. ;
  57. ;--------------------------------------------------------------------------------------
  58. ; Various parameters 
  59. ;--------------------------------------------------------------------------------------
  60. ;
  61.  
  62. ; ALMConfirmName reports these results
  63.  
  64. ALMConfirmRenameConfig            EQU        1
  65. ALMConfirmReplaceConfig            EQU        2
  66.  
  67. ;  ALMSwitchToLocation masks
  68.  
  69. kALMDefaultSwitchFlags            EQU        0
  70. kALMDontShowStatusWindow        EQU        1
  71. kALMSignalViaAE                    EQU        2
  72.  
  73. kALMLocationNameMaxLen            EQU        31
  74. kALMMaxLocations                EQU        16                    ; arbitrary limit.  enforced by LocatioManager.
  75. kALMNoLocationIndex                EQU        -1                    ; index and token for the 'off' location
  76. kALMNoLocationToken                EQU        -1
  77. kAELocationNotice                EQU        'walk'                ; Notification AEvent sent to apps when location changes
  78. kALMFileCreator                    EQU        'walk'                ; creator type of LocatioManager files
  79.  
  80. ;  gestalt selectors
  81.  
  82. gestaltALMVers                    EQU        'walk'
  83. gestaltALMAttr                    EQU        'trip'
  84. gestaltALMPresent                EQU        0
  85.  
  86. ;
  87. ;--------------------------------------------------------------------------------------
  88. ; Dispatched trap API
  89. ;--------------------------------------------------------------------------------------
  90. ;
  91. ;
  92. ; pascal OSErr ALMGetCurrentLocation(SInt16 *index, ALMToken *token, Str31 name)
  93. ;
  94.     IF ¬ GENERATINGCFM THEN
  95.         Macro
  96.         _ALMGetCurrentLocation
  97.             move.w              #$0600,D0
  98.             dc.w                $AAA4
  99.         EndM
  100.     ELSE
  101.         IMPORT_CFM_FUNCTION ALMGetCurrentLocation
  102.     ENDIF
  103.  
  104. ;
  105. ; pascal OSErr ALMGetIndLocation(SInt16 index, ALMToken *token, Str31 name)
  106. ;
  107.     IF ¬ GENERATINGCFM THEN
  108.         Macro
  109.         _ALMGetIndLocation
  110.             move.w              #$0501,D0
  111.             dc.w                $AAA4
  112.         EndM
  113.     ELSE
  114.         IMPORT_CFM_FUNCTION ALMGetIndLocation
  115.     ENDIF
  116.  
  117. ;
  118. ; pascal OSErr ALMCountLocations(SInt16 *nLocations)
  119. ;
  120.     IF ¬ GENERATINGCFM THEN
  121.         Macro
  122.         _ALMCountLocations
  123.             move.w              #$0202,D0
  124.             dc.w                $AAA4
  125.         EndM
  126.     ELSE
  127.         IMPORT_CFM_FUNCTION ALMCountLocations
  128.     ENDIF
  129.  
  130. ;
  131. ; pascal OSErr ALMSwitchToLocation(ALMToken newLocation, SInt32 switchFlags)
  132. ;
  133.     IF ¬ GENERATINGCFM THEN
  134.         Macro
  135.         _ALMSwitchToLocation
  136.             move.w              #$0403,D0
  137.             dc.w                $AAA4
  138.         EndM
  139.     ELSE
  140.         IMPORT_CFM_FUNCTION ALMSwitchToLocation
  141.     ENDIF
  142.  
  143. ;
  144. ; pascal OSErr ALMRegisterNotifyProc(ALMNotificationUPP notificationProc, const ProcessSerialNumber *whichPSN)
  145. ;
  146.     IF ¬ GENERATINGCFM THEN
  147.         Macro
  148.         _ALMRegisterNotifyProc
  149.             move.w              #$0404,D0
  150.             dc.w                $AAA4
  151.         EndM
  152.     ELSE
  153.         IMPORT_CFM_FUNCTION ALMRegisterNotifyProc
  154.     ENDIF
  155.  
  156. ;
  157. ; pascal OSErr ALMRemoveNotifyProc(ALMNotificationUPP notificationProc, const ProcessSerialNumber *whichPSN)
  158. ;
  159.     IF ¬ GENERATINGCFM THEN
  160.         Macro
  161.         _ALMRemoveNotifyProc
  162.             move.w              #$0405,D0
  163.             dc.w                $AAA4
  164.         EndM
  165.     ELSE
  166.         IMPORT_CFM_FUNCTION ALMRemoveNotifyProc
  167.     ENDIF
  168.  
  169. ;
  170. ; pascal OSErr ALMConfirmName(ConstStr255Param msg, Str255 configName, SInt16 *choice, ModalFilterUPP filter)
  171. ;
  172.     IF ¬ GENERATINGCFM THEN
  173.         Macro
  174.         _ALMConfirmName
  175.             move.w              #$0806,D0
  176.             dc.w                $AAA4
  177.         EndM
  178.     ELSE
  179.         IMPORT_CFM_FUNCTION ALMConfirmName
  180.     ENDIF
  181.  
  182. ;
  183. ;--------------------------------------------------------------------------------------
  184. ; Location Manager User Module API
  185. ;--------------------------------------------------------------------------------------
  186. ;
  187.  
  188. kALMComponentType                EQU        'walk'                ; These masks apply to the "flags" field in the ComponentDescription record. 
  189. kALMMultiplePerLocation            EQU        1                    ; this module can be added more than once to a location
  190.                                                             ; this module's settings' descriptions can change even 
  191. kALMDescriptionGetsStale        EQU        2                    ; when the setting didn't change.
  192.  
  193. ; typedef UInt32                         ALMComponentFlagsEnum
  194.  
  195. ; typedef UInt32                         ALMRebootFlags
  196.  
  197.  
  198.                                                             ; These are the possible values of ALMRebootFlags to be returned in the 'flags' parameter of ALMSetCurrent() 
  199. kALMNoChange                    EQU        0
  200. kALMAvailableNow                EQU        1
  201. kALMFinderRestart                EQU        2
  202. kALMProcesses                    EQU        3
  203. kALMExtensions                    EQU        4
  204. kALMWarmBoot                    EQU        5
  205. kALMColdBoot                    EQU        6
  206. kALMShutdown                    EQU        7
  207.  
  208. kALMScriptInfoVersion            EQU        2
  209. ALMScriptMgrInfo        RECORD 0
  210. version                     ds.w    1                ; offset: $0 (0)        ;  set to kALMScriptInfoVersion
  211. scriptCode                 ds.w    1                ; offset: $2 (2)
  212. regionCode                 ds.w    1                ; offset: $4 (4)
  213. langCode                 ds.w    1                ; offset: $6 (6)
  214. fontNum                     ds.w    1                ; offset: $8 (8)
  215. fontSize                 ds.w    1                ; offset: $A (10)
  216. sizeof                     EQU *                    ; size:   $C (12)
  217.                         ENDR
  218.  
  219.     ENDIF ; __LOCATIONMANAGER__ 
  220.  
  221.